'use strict';

var mongoose = require('bluebird').promisifyAll(require('mongoose'));
import {Schema} from 'mongoose';

var BlogSchema = new Schema({
  title: String,
  content: String,
  author_id: String,
  author_name: String,
  describe: String,
  comment: [{type: Schema.Types.ObjectId, ref:'BlogCommentSchema'}],
  create_time: {type: Date, default: Date.now},
  read_count: Number,
  deleted: Boolean,
});

export default mongoose.model('blog', BlogSchema);
